home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_071 / amibas / lib2 (.txt) < prev    next >
AmigaBASIC Source Code  |  1992-05-06  |  2KB  |  70 lines

  1. REM - This demo program shows how to 
  2. REM - call Amiga system routines from
  3. REM - AmigaBasic.
  4. REM - Difference to program Library:
  5. REM - also disk resident fonts can
  6. REM - be activated.
  7.  
  8. DECLARE FUNCTION AskSoftStyle& LIBRARY
  9. DECLARE FUNCTION OpenDiskFont& LIBRARY
  10. DECLARE FUNCTION Execute& LIBRARY
  11.  
  12.   LIBRARY "graphics.library"
  13.   LIBRARY "diskfont.library"
  14.  
  15.   enable%=AskSoftStyle&(WINDOW(8))
  16.   Font "topaz.font",8,0,0
  17.   FOR i=0 TO 4
  18.     SetStyle CINT(2^i)
  19.   NEXT i
  20.  
  21.   PRINT :PRINT 
  22.   
  23.   Font "opal.font",12,0,0
  24.   enable%=AskSoftStyle&(WINDOW(8))
  25.   FOR i=0 TO 4
  26.     SetStyle CINT(2^i)
  27.   NEXT i
  28.  
  29.   SetStyle 0
  30.   Font "topaz.font",8,0,0
  31.   Font "",0,0,0  ' closes last font 
  32.  
  33.   REM --- Next line only works, if
  34.   REM --- AmigaBasic was called from
  35.   REM --- CLI and not from Workbench.
  36.   ' DosLibDemo
  37.   LIBRARY CLOSE
  38. END
  39.  
  40. SUB Font(fontName$, height%, style%, prefs%) STATIC
  41.   SHARED pFont&
  42.   ' Herewith every font (also form disk) useable.
  43.   IF pFont&<>0 THEN CALL CloseFont(pFont&)
  44.   fontName0$=fontName$+CHR$(0)
  45.   textAttr&(0)=SADD(fontName0$)
  46.   textAttr&(1)=height%*65536 + style%*256 + prefs%
  47.   pFont&=OpenDiskFont&(VARPTR(textAttr&(0)))
  48.   IF pFont& <> 0 THEN SetFont WINDOW(8),pFont&
  49. END SUB
  50.  
  51. SUB SetStyle(mask%) STATIC
  52.   SHARED enable%
  53.   SetSoftStyle WINDOW(8),mask%,enable%
  54.   PRINT "SetSoftStyle(";mask%;")"
  55. END SUB
  56.  
  57. SUB DosLibDemo STATIC
  58.   LIBRARY "dos.library"
  59.   ' This activates the function Execute from dos.library.
  60.   x=Execute&(SADD("list >RAM:temp"+CHR$(0)), 0, 0)
  61.   OPEN "RAM:temp" FOR INPUT AS 1
  62.   WHILE NOT EOF(1)
  63.     LINE INPUT #1,a$
  64.     PRINT a$
  65.   WEND
  66.   CLOSE
  67.   KILL "RAM:temp"
  68. END SUB
  69.  
  70.